#include "behavior_tree_reactive_sequence_policy.h"
#include <behaviortree_cpp_v3/controls/reactive_sequence.h>

namespace policy
{
BehaviorTreeReactiveSequencePolicy::BehaviorTreeReactiveSequencePolicy(const std::string &name)
    : BehaviorTreePolicy(name)
{
    policy_tree_node_ = std::make_unique<BT::ReactiveSequence>(name + "_reactive_sequence_node");
}
bool BehaviorTreeReactiveSequencePolicy::setReactiveTask(const task::AbstractTaskConstPtr &task)
{
    //TODO,这里多次插入会不会影响后面的node
    return BehaviorTreePolicy::insertTask(0, task);
}
bool BehaviorTreeReactiveSequencePolicy::setReactivePolicy(const AbstractPolicyConstPtr &policy)
{
    return BehaviorTreePolicy::insertPolicy(0, policy);
}
BehaviorTreeReactiveSequencePolicy::~BehaviorTreeReactiveSequencePolicy() = default;

}
